<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>

import jwt_decode from 'jwt-decode'
export default {
  name: 'app',
  components: {

  },
  created() {
    if (localStorage.getItem('mytoken')) {
      const decode = jwt_decode(localStorage.mytoken)
      const userinfo = {
        user: decode.username,
        token: decode.token
      }
      this.$store.commit('setUser', userinfo)
    }
  }
}
</script>

<style>
html,
body {
  margin: 0;
  padding: 0;
}

#app {
  height: 100vh;

}
</style>
